Ext.define('Admin.view.main.module.Property', {
    extend: 'Ext.panel.Panel',
    xtype: 'moduleproperty',
    layout: 'border',

    initComponent: function () {
        this.model = Admin.view.main.factory.ModelFactory.getModelByName(this.moduleName);
        this.store = Ext.create('Admin.store.Base', {
            model: this.model,
            proxy: {
                url: "/dict/" + this.url,
                headers: {
                    'X-CSRF-Token': document.querySelector('meta[name="csrf-token"]').getAttribute('content')
                }
            }
        });
        this.items = [{
            xtype: 'grid',
            itemId: 'name-list',
            region: 'west',
            split: true,
            width: 250,
            store: this.store,
            columns: Admin.view.main.factory.ColumnsFactory.getNameColumn(this.moduleName),
            dockedItems: [{
                xtype: 'pagingtoolbar',
                store: this.store,
                dock: 'bottom'
            }]
        }, {
            xtype: 'propertygrid',
            region: 'center',
            source: {}
        }];
        this.callParent();
    }
});
